package cn.apthink.schedule;

import java.time.LocalDate;

import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
public class PlanDetail {
	private String id;
	private String jobId;
	private int planAmount;
	private int jobAmount;
	private double sam;
	private double efficiency;
	private String productId;
	private String customerId;
	private String styleId;
	private LocalDate earliestStartDate;
	private LocalDate latestEndDate;
	
	public PlanDetail(String id, String jobId, int planAmount, int jobAmount, double sam, double efficiency) {
		this.id = id;
		this.jobId = jobId;
		this.planAmount = planAmount;
		this.jobAmount = jobAmount;
		this.sam =sam;
		this.efficiency = efficiency;
	}
	
	// 负载
	public double loadding() {
		return planAmount *sam;
	}
	
	// 考虑效率的负载
	public double loaddingByEfficiency() {
		return loadding() / efficiency;
	}
	
	public static PlanDetail testData() {
		PlanDetail detail = new PlanDetail("pd01","j01",10 ,20,1080,0.8);
		return detail;
	}
}
